<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 300px;
            height: 300px;
            background-color: #ccc;
        }
    </style>
</head>
<body>
    <script>
        window.addEventListener('load',function(e){
            var div = document.getElementsByTagName('div')[0]
            // onresize事件监听窗口变化
            window.addEventListener('resize',function(e){
                // 获取当前窗口的宽度
                if (window.innerWidth <1000)
                div.style.display = 'none'
                else
                div.style.display = 'inherit'
            })
        })
    </script>
    <div>

    </div>
</body>
</html>